package com.youxin.foundation.lang;


/**
 * 基础异常类
 * @author yingde.cao
 *
 */
public class BaseException extends RuntimeException {
	
	private static final long serialVersionUID = 132598409325409L;
	public static final int FAILURE_CODE=-2;
	public static final int USERFAILURE_CODE=-1;
	
	private  int code=USERFAILURE_CODE;
	private  String msg;

	public BaseException(int code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}

	public BaseException(String message) {
        super(message);
        this.msg=message;
    }
	
	public int getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	@Override
	public String toString() {		
		return this.getClass().getSimpleName()+" [code=" + code + ", msg=" + msg + "]";
	}

}